<template>
  <TodoInput />
  <TodoList :todoList="todoList" />
</template>

<script lang="ts">
import { computed, defineComponent, onMounted } from "vue";
import TodoInput from "@/components/TodoInput/index.vue";
import TodoList from "@/components/TodoList/index.vue";
import { TodoManager } from "@/hooks/TodoManage";
import { useStore, Store } from "vuex";

export default defineComponent({
  name: "App",
  components: {
    TodoInput,
    TodoList,
  },
  setup() {
    const store: Store<any> = useStore();
    const { SetTodoList } = TodoManager();
    onMounted(() => {
      SetTodoList();
    });
    return {
      todoList: computed(() => store.state.list),
    };
  },
});
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
